package com.rysima.wjsima.demo.demo2;

import java.util.concurrent.atomic.AtomicInteger;

public class Demo1 {
    public static void main(String[] args) {
        AtomicInteger ac = new AtomicInteger(10);
        int andDecrement = ac.getAndDecrement();
        System.out.println(ac.get());
        System.out.println(andDecrement);
        AtomicInteger ac1 = new AtomicInteger(15);
        int dc = ac1.getAndIncrement();
        System.out.println(dc);
        System.out.println(ac1.get());
        AtomicInteger ac2 = new AtomicInteger(10);
        int d = ac2.incrementAndGet();
        System.out.println(ac2.get());
        System.out.println(d);
        AtomicInteger ac3 = new AtomicInteger(10);
        int andSet = ac3.getAndSet(15);
        System.out.println(ac3);
        System.out.println(andSet);

    }
}
